package com.jlc.o2o.util;

public class PathUtil {
    //获取系统文件的分割符
    private static String seperator = System.getProperty("file.separator");

    //获取项目的根路径
    public static String getImgBasePath(){

        //获取系统名称
        String os = System.getProperty("os.name");
        String basePath;
        if(os.toLowerCase().startsWith("win")){
            basePath = "D:/img/o2o/";
        }else {//linux
            basePath = "/home/xiangze/image";
        }

        basePath = basePath.replace("/", seperator);
        System.out.println(basePath);
        return basePath;
    }


    //项目图片的子路径
    public static String getShopImagePath(long shopId){
        String imagePath = "upload/item/shop/" + shopId +"/";
        return imagePath.replace("/", seperator);
    }
}
